<!-- @format -->

<!--热力图-->
<template>
    <div ref="chart"></div>
</template>

<script>
    import { renderHeatmap } from '../../../packages/src/util/nomalChart'
    import mixin from '../../../packages/src/util/mixin'
    export default {
        name: 'ZHeatmap',
        mixins: [mixin],
        data() {
            return {
                businessConfigs: {
                    waterGrades: {
                        type: 'piecewise',
                        categories: ['致命', '严重', '告警', '一般'],
                        color: 'alarmColor',
                    },
                },
            }
        },
        props: {
            business: {
                type: String,
            },
        },
        methods: {
            initChart() {
                let businessConfig = this.businessConfigs[this.business] || {}
                let config = Object.assign({}, businessConfig, this.config)
                return renderHeatmap(this.data, config)
            },
        },
    }
</script>

<style scoped></style>
